package com.ourteam.workspace.api;

import com.ourteam.frame.web.AbstractSearchModel;
import com.ourteam.workspace.dao.WorkspaceProductDatabaseModelRelateDAOQueryBean;
import com.ourteam.workspace.domain.WorkspaceProductDatabaseModelRelateBean;

public class WorkspaceDatabaseRelatedDBPackageSearchModel
		extends AbstractSearchModel<WorkspaceProductDatabaseModelRelateDAOQueryBean> {

	private long workspaceDatabaseId;
	
	public long getWorkspaceDatabaseId() {
		return workspaceDatabaseId;
	}

	public void setWorkspaceDatabaseId(long workspaceDatabaseId) {
		this.workspaceDatabaseId = workspaceDatabaseId;
	}

	@Override
	public String getMappedDAOField(String aProperty) {
		return WorkspaceProductDatabaseModelRelateBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(WorkspaceProductDatabaseModelRelateDAOQueryBean queryBean) throws Exception {
		
		WorkspaceProductDatabaseModelRelateDAOQueryBean.Criteria criteria = queryBean.createCriteria();
		
		if(workspaceDatabaseId != 0) {
			criteria.andWorkspaceProductDatabaseRelateIdEqualTo(workspaceDatabaseId);
		}
		
	}

}
